﻿//------------------------------------------------------------
// Game Framework
// Copyright © 2013-2020 Jiang Yin. All rights reserved.
// Homepage: https://gameframework.cn/
// Feedback: mailto:ellan@gameframework.cn
//------------------------------------------------------------
// 此文件由工具自动生成，请勿直接修改。
// 生成时间：2025-10-28 18:31:19.837
//------------------------------------------------------------

using GameFramework;
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using UnityEngine;
using UnityGameFramework.Runtime;

namespace TowerDefence_Zombie
{
    /// <summary>
    /// 引导配置。
    /// </summary>
    public class DRGuide : DataRowBase
    {
        private int m_Id = 0;

        /// <summary>
        /// 获取配置编号。
        /// </summary>
        public override int Id
        {
            get
            {
                return m_Id;
            }
        }

        /// <summary>
        /// 获取是否暂停游戏。
        /// </summary>
        public bool IsPause
        {
            get;
            private set;
        }

        /// <summary>
        /// 获取是否允许拖拽场景内的炮塔。
        /// </summary>
        public bool IsAllowOperateScemeTower
        {
            get;
            private set;
        }

        /// <summary>
        /// 获取是否禁用回收站。
        /// </summary>
        public bool IsDisableRecycle
        {
            get;
            private set;
        }

        /// <summary>
        /// 获取放置位高亮提示。
        /// </summary>
        public int HighligtPlace
        {
            get;
            private set;
        }

        /// <summary>
        /// 获取引导前置UI。
        /// </summary>
        public int PreUIID
        {
            get;
            private set;
        }

        /// <summary>
        /// 获取手指出现位置路径。
        /// </summary>
        public string FingerBeginPath
        {
            get;
            private set;
        }

        /// <summary>
        /// 获取手指拖动指向位置路径。
        /// </summary>
        public string FingerTargetPath
        {
            get;
            private set;
        }

        /// <summary>
        /// 获取蒙版镂空位置路径。
        /// </summary>
        public string HollowOutPath
        {
            get;
            private set;
        }

        /// <summary>
        /// 获取提示内容。
        /// </summary>
        public string HintStr
        {
            get;
            private set;
        }

        /// <summary>
        /// 获取提示文本位置路径。
        /// </summary>
        public string HintPath
        {
            get;
            private set;
        }

        /// <summary>
        /// 获取引导触发条件。
        /// </summary>
        public int[] TriggerCondition
        {
            get;
            private set;
        }

        /// <summary>
        /// 获取引导完成条件。
        /// </summary>
        public int[] CompleteCondtion
        {
            get;
            private set;
        }

        /// <summary>
        /// 获取引导组。
        /// </summary>
        public int GuideGroup
        {
            get;
            private set;
        }

        public override bool ParseDataRow(string dataRowString, object userData)
        {
            string[] columnStrings = dataRowString.Split(DataTableExtension.DataSplitSeparators);
            for (int i = 0; i < columnStrings.Length; i++)
            {
                columnStrings[i] = columnStrings[i].Trim(DataTableExtension.DataTrimSeparators);
            }

            int index = 0;
            index++;
            m_Id = int.Parse(columnStrings[index++]);
            index++;
            IsPause = bool.Parse(columnStrings[index++]);
            IsAllowOperateScemeTower = bool.Parse(columnStrings[index++]);
            IsDisableRecycle = bool.Parse(columnStrings[index++]);
            HighligtPlace = int.Parse(columnStrings[index++]);
            PreUIID = int.Parse(columnStrings[index++]);
            FingerBeginPath = columnStrings[index++];
            FingerTargetPath = columnStrings[index++];
            HollowOutPath = columnStrings[index++];
            HintStr = columnStrings[index++];
            HintPath = columnStrings[index++];
                TriggerCondition = DataTableExtension.ParseInt32Array(columnStrings[index++]);
                CompleteCondtion = DataTableExtension.ParseInt32Array(columnStrings[index++]);
            GuideGroup = int.Parse(columnStrings[index++]);

            GeneratePropertyArray();
            return true;
        }

        public override bool ParseDataRow(byte[] dataRowBytes, int startIndex, int length, object userData)
        {
            using (MemoryStream memoryStream = new MemoryStream(dataRowBytes, startIndex, length, false))
            {
                using (BinaryReader binaryReader = new BinaryReader(memoryStream, Encoding.UTF8))
                {
                    m_Id = binaryReader.Read7BitEncodedInt32();
                    IsPause = binaryReader.ReadBoolean();
                    IsAllowOperateScemeTower = binaryReader.ReadBoolean();
                    IsDisableRecycle = binaryReader.ReadBoolean();
                    HighligtPlace = binaryReader.Read7BitEncodedInt32();
                    PreUIID = binaryReader.Read7BitEncodedInt32();
                    FingerBeginPath = binaryReader.ReadString();
                    FingerTargetPath = binaryReader.ReadString();
                    HollowOutPath = binaryReader.ReadString();
                    HintStr = binaryReader.ReadString();
                    HintPath = binaryReader.ReadString();
                        TriggerCondition = binaryReader.ReadInt32Array();
                        CompleteCondtion = binaryReader.ReadInt32Array();
                    GuideGroup = binaryReader.Read7BitEncodedInt32();
                }
            }

            GeneratePropertyArray();
            return true;
        }

        private void GeneratePropertyArray()
        {

        }
    }
}
